]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
runDialog: Don't return from finally block
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Feb 2019 12:22:41 +0000 (13:22 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 1 Jul 2019 21:09:49 +0000 (21:09 +0000)
Control flow statements like return, break or continue are considered
unsafe in finally blocks, as they take precendence over any control
flow statement in the try and catch blocks, which may be unexpected.

This isn't the case here as the statement in the finally block is the
only one, but we can just as well avoid the finally block altogether
and use a regular return statement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

js/ui/runDialog.js

index a4ac8c82b3c8126006eb58751332128d14eca4a1..9186ff7bb670aa1a746c49c39eeb6da2d63e5778 100644 (file)
@@ -169,9 +169,8 @@ class RunDialog extends ModalDialog.ModalDialog {
                 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) &&
                     !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_DIRECTORY))
                     log(e);
-            } finally {
-                return results;
             }
+            return results;
         });
         let results = someResults.reduce((a, b) => a.concat(b), []);